package cn.csxw.openchina.dagger2.presenter;

import java.util.ArrayList;

import javax.inject.Inject;

import cn.csxw.openchina.entity.bean.FriendBean;
import cn.csxw.openchina.entity.bean.OsChinaBean;
import cn.csxw.openchina.ui.fragment.myFragment.MyFollowFragment;
import retrofit2.Call;

/**
 * 我的界面中 关 注   的网络访问
 */

public class MyFollowFragmentPresenter extends BasePresenter {
    private MyFollowFragment mMyFollowFragment;
    private ArrayList<FriendBean> mFriends;

    @Inject
    public MyFollowFragmentPresenter(MyFollowFragment myFollowFragment) {
        mMyFollowFragment = myFollowFragment;
    }
    @Override
    protected void processData(OsChinaBean data) {
        if (data!=null){
            //获取数据
            mFriends = (ArrayList<FriendBean>) data.friends;
            mMyFollowFragment.mAdapter.setData(mFriends);
        }

    }
    @Override
    public void callNetWork(Object... params) {
        Call<OsChinaBean> finsInfo = mOsChinaServer.getFinsInfo((String) params[0],
                (int) params[1], (int) params[2], (int) params[3]);
        finsInfo.enqueue(mCallback);
    }
}
